package be.novelfaces.webdriver.component.primefaces;

import java.util.Map;

import org.openqa.selenium.By;

import be.novelfaces.webdriver.BaseComponent;

import com.google.common.collect.Maps;

public class AccordionPanel extends BaseComponent {
	
	private Map<By, Tab<? extends TabContent>> tabs = Maps.newHashMap();

	public AccordionPanel(By compId) {
		super(compId);
	}
	
	public <T extends TabContent> void addTab(Tab<T> tab) {
		this.tabs.put(tab.getComponentBy(), tab);
	}
	
	@SuppressWarnings("unchecked")
	public <T extends TabContent> Tab<T> getTab(By by, Class<T> contentClass) {
		return (Tab<T>) tabs.get(by);
	}

}
